package com.qingcloud.adminbackend.entity.sysstation;/**
 * @param TODO
 * @author TanLin
 * @date 2019/4/16
 */

import com.qingcloud.adminbackend.base.ElementPageParams;

import java.util.List;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @param TODO
 * @Description TODO
 * @Author TanLin
 * @Date 2019/4/16 18:40
 */

@Data
public class StationListPara extends ElementPageParams {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "设备ID", example = "119")
    private String equipmentId;

    @ApiModelProperty(value = "城市编号", example = "110100")
    private String domainId;

    @ApiModelProperty(value = "业务类型", example = "1")
    private String workType;

    @ApiModelProperty(value = "站点编号或名称", example = "17002")
    private String stationIdOrName;

    @ApiModelProperty(value = "客户编号", example = "ebcaecd7049641009a01d0c2f428c5f4")
    private List<String> orgIds;

    @ApiModelProperty(value = "订单编号", example = "a966a133831545a39bcb21d275a40fec")
    private List<String> orderIds;

    @ApiModelProperty(value = "共享状态列表", example = "1")
    private List<String> sharedList;

    @ApiModelProperty(value = "状态列表", example = "2")
    private List<String> stats;

    @ApiModelProperty(value = "监测点种类列表", example = "2")
    private List<String> stationCatagorys;

    @ApiModelProperty(value = "监测点类型列表", example = "18")
    private List<String> stationTypes;


    @ApiModelProperty(value = "空间", example = "1")
    private String moName;

    @ApiModelProperty(value = "设备组", example = "1")
    private String stationGroup;

    @ApiModelProperty(value = "绑定标志", example = "1")
    private String bindFlag;

    @ApiModelProperty(value = "未绑定标志", example = "0")
    private String unbindFlag;

    @ApiModelProperty(value = "绑定列表", example = "0")
    private List<String> bindList;

    /**
     * 解析bindlist 赋值bindFlag,unbindFlag
     */
    public void parseBindList() {
        if (bindList == null) {
            bindFlag = "0";
            unbindFlag = "0";
        } else if (bindList.size() == 1) {
            final String s = bindList.get(0);
            if ("1".equalsIgnoreCase(s)) {
                bindFlag = "1";
                unbindFlag = "0";
            } else {
                unbindFlag = "1";
                bindFlag = "0";
            }
        } else if (bindList.size() == 2) {
            unbindFlag = "1";
            bindFlag = "1";
        } else {
            unbindFlag = "0";
            bindFlag = "0";
        }
    }
}
